package com.imooc.service.combine.impl;

import com.imooc.model.bo.HeadLine;
import com.imooc.model.bo.ShopCategory;
import com.imooc.model.dto.MainPageInfoDTO;
import com.imooc.model.dto.Result;
import com.imooc.service.combine.HeadLineShopCategoryCombineService;
import com.imooc.service.solo.HeadLineService;
import com.imooc.service.solo.ShopCategoryService;
import java.util.List;

/**
 * @author MarkerCCC
 * @date 2022/3/26 - 17:20
 * @since 2022/3/26 - 17:20 星期六 by MarkerCCC markerccc@163.com
 */
public class HeadLineShopCategoryCombineServiceImpl implements HeadLineShopCategoryCombineService {

    private HeadLineService headLineService;

    private ShopCategoryService shopCategoryService;


    @Override
    public Result<MainPageInfoDTO> getMainPageInfo() {
        HeadLine headLineCondition = new HeadLine();
        headLineCondition.setEnableStatus(1);

        // 1. 获取头条列表
        Result<List<HeadLine>> headLineResult = headLineService.queryHeadLine(headLineCondition, 1, 10);
        // 2. 获取店铺类别列表
        ShopCategory shopCategoryCondition = new ShopCategory();
        Result<List<ShopCategory>> shopCategoryResult = shopCategoryService.queryShopCategory(shopCategoryCondition, 1, 10);

        // 3. 合并两者并返回

        return mergeMainPageInfoResult(headLineResult, shopCategoryResult);
    }

    private Result<MainPageInfoDTO> mergeMainPageInfoResult(Result<List<HeadLine>> headLineResult,
            Result<List<ShopCategory>> shopCategoryResult) {

        return null;
    }
}
